<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<a href="javascript:toPage(1)">首页</a>
<a href="javascript:toPage(2)">上一页</a>
<a href="javascript:toPage(3)">下一页</a>
<a href="javascript:toPage(4)">尾页</a>

<form id="formId">
    当前第<input type="text" id="pageNumber" name="pageNum" size="1" readonly>页
    共<input type="text" id="totalPage" name="totalPage" size="1" readonly>页
    每页<input type="text" id="pageSize" name="pageSize" size="1" readonly>条
    共<input type="text" id="totalCount" name="totalCount" size="1" readonly>条
</form>
<script>
    function toPage(flag) {
        var pageNumber = parseInt($("#pageNumber").val());
        var totalPage = parseInt($("#totalPage").val());
        if (flag == 1) {
            if (pageNumber <= 1) {
                alert("已经为首页");
                return;
            }
            $("#pageNumber").val(1);
        } else if (flag == 2) {
            if (pageNumber <= 1) {
                alert("已经为首页");
                return;
            }
            $("#pageNumber").val(pageNumber - 1);
        } else if (flag == 3) {
            if (pageNumber == totalPage) {
                alert("已经是尾页");
                return;
            }
            $("#pageNumber").val(pageNumber + 1);
        } else if (flag == 4) {// 尾页
            if (pageNumber == totalPage) {
                alert("已经是尾页");
                return;
            }
            $("#pageNumber").val(totalPage);
        }

        show();
    }

    function install_page(page) {
        // 页面分数参数赋值
        $("#pageNumber").val(page.pageNum);
        $("#totalPage").val(page.pages);
        $("#pageSize").val(page.pageSize);
        $("#totalCount").val(page.total);
    }
</script>
</body>
</html>